import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
import Login from '@/views/Login'
import Home from '@/views/Home'
import Welcome from '@/views/Welcome'
import User from '@/views/user/User'

Vue.use(Router)

export default new Router({
  // 路由模式：hash(默认)，history模式
	mode: 'history',
	// 修改路由高亮样式，默认值为'router-link-active'
	linkActiveClass: 'active',
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/',
      name: 'Home',
      component: Home,
      redirect:{name:'Welcome'},//重定向到首页的welcome子路由
      children:[{
        path:'welcome',
        name:'Welcome',
        component:Welcome
      },
      {
        path:'user',
        name:'User',
        component:User
      },
    ]
    }
  ]
})
